package Visitor;

import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Iterator;

public class BuyBasket {
    private ArrayList list= new ArrayList();

    public void accept(AbstractVisitor visitor)
    {
        Iterator i = list.iterator();

        while(i.hasNext())
        {
            ((IProduct)i.next()).accept(visitor);
        }
    }

    public void addProduct(IProduct product)
    {
        list.add(product);
    }

    public void removeProduct(IProduct product)
    {
        list.remove(product);
    }

}
